package com.huangpeng.algorithm.dijestra;

/**
 * @Author hp
 * @Title 迪杰斯特拉算法主函数入口
 * @Package
 * @Date 2021/12/31 16:13
 * @Description
 * @Version 1.0
 */
public class Djkstra {
    public static void main(String[] args) {
        char[] vertex = new char[]{ 'A', 'B', 'C', 'D', 'E', 'F', 'G' };
        int[][] arr = new int[vertex.length][vertex.length];
        final int N = 100;
        arr[0] = new int[] { N, 5, 7, N, N, N, 2 };
        arr[1] = new int[] { 5, N, N, 9, N, N, 3 };
        arr[2] = new int[] { 7, N, N, N, 8, N, N };
        arr[3] = new int[] { N, 9, N, N, N, 4, N };
        arr[4] = new int[] { N, N, 8, N, N, 5, 4 };
        arr[5] = new int[] { N, N, N, 4, 5, N, 6 };
        arr[6] = new int[] { 2, 3, N, N, 4, 6, N };
        //创建图对象
        Graph graph = new Graph(vertex,arr);
        graph.show();
        graph.djk(2);
        graph.djkShow();
    }
}
